<template>
	<div id="content">
		<Header />
		<div class="bread">
			<div class="cont w1200">
				<img src="../../../assets/img/location.png" alt=""><a><router-link
						to="/portal/index">首页</router-link></a> > <a><router-link
						to="/portal/net">网谷里</router-link></a>><a>民情动态</a>
				<a href="" class="back"><img src="../../../assets/img/back.png" alt=""><router-link
						to="/portal/net">返回上一级</router-link></a>
			</div>
		</div>
		<div class="inner">
			<div class="net w1200">
				<h3>民情动态详情</h3>
				<div class="form">
					<div class="form-right">
						<div class="form-detail">
							<div class="form-list">
								<h5 style="font-weight: bold">{{ data.title }}</h5>
                <div class="operate">
                  <div class="left">
                    <span style="margin-right: 50px;">联系对象：{{ data.contactPerson }}</span> <span
                    style="margin-right: 50px;">联系人：{{ data.voterName
                    }}</span> <span style="margin-right: 50px;">提交时间： {{ data.submitTime
                    }}</span>
                  </div>
                </div>
                <div class="text"></div>
								<p v-html="data.content"></p>
							</div>
						</div>
            <div class="input2">
              代表回复
              <editor v-model="data.feedbackContent" placeholder="请输入内容" :min-height="300" style="margin-top: 20px"/>
            </div>
						<div class="btn" @click="submitForm" >提交</div>
					</div>

				</div>

			</div>
		</div>
		<Contact />
	</div>

</template>

<script>
import Header from '@/components/Header';
import Contact from '@/components/Contact';
import { getTrendsDetail } from "@/api/website";
import {updatePublicOpinion} from "@/api/PublicOpinion/PublicOpinion";

export default {
	data() {
		return {
			data: {}
		}
	},
	components: {
		Header,
		Contact
	},
	created() {
		this.userInfo = JSON.parse(sessionStorage.getItem("useInfo"))

		this.init()
	},
	mounted() {

	},
	methods: {
		init() {
			getTrendsDetail(this.$route.query.id).then(response => {
				this.data = response.data;
			});
		},
    /** 提交按钮 */
    submitForm() {
      this.data.feedbackTime=Date.now()
      this.data.voterStatus=2
      updatePublicOpinion(this.data).then(response => {
        this.$modal.msgSuccess("修改成功");
        this.$router.push({path:'/portal/net/trends'})
      });
    },
	}

};
</script>

<style scoped lang="scss">
.reply {
	textarea {
		width: 100%;
		height: 100%;
		border:1px solid #CCCCCC;
	}
}

.btn {
		margin-top: 20px;
		width: 130px;
		height: 40px;
		line-height: 40px;
		background: #266DC3;
		color: #fff;
		text-align: center;
		margin-right: 20px;
		cursor: pointer;
	}
</style>
